package com.study.concurrent.B_ThreadSynchronizedBasic.h_UserMultipleConditionInLock;

/**
 * Created by 赵超 on 2017/3/23.
 */
public class Main {
    public static void main(String[] args) {
        FileMock mock = new FileMock(100, 10);
        Buffer buffer = new Buffer(20);

        Producer producer = new Producer(mock, buffer);
        Thread threadProducer = new Thread(producer, "Producer");

        Consumer[] consumers = new Consumer[3];
        Thread[] threadsCosumers = new Thread[3];
        for (int i = 0; i < 3; i++) {
            consumers[i] = new Consumer(buffer);
            threadsCosumers[i] = new Thread(consumers[i], "Consumer_" + i);
        }

        threadProducer.start();
        for (int i = 0; i < 3; i++) {
            threadsCosumers[i].start();
        }

    }
}
